<template>
  <div>
    <div class="classify">
      <div class="group">
        <span class="leftId">租房小组</span><span class="rightId">更多</span>
      </div>
      <van-grid :border="false" direction="horizontal" :column-num="2">
        <van-grid-item
          v-for="value in list"
          :key="value.id"
          :icon="'http://liufusong.top:8080' + value.imgSrc"
        >
          <template #text>
            <div>
              <div style="font-size: 14px; padding-left: 10px">
                {{ value.title }}
              </div>
              <div style="font-size: 14px; padding-left: 10px">
                {{ value.desc }}
              </div>
            </div>
          </template></van-grid-item
        >
      </van-grid>
    </div>
  </div>
</template>

<script>
import { groups } from '@/api/article'

export default {
  name: 'RentalGroups',
  async created () {
    const res = await groups()
    this.list = res.body
  },
  data () {
    return {
      list: []
    }
  }
}
</script>

<style lang="less" scoped>
.classify {
  height: 187px;
  background-color: #f6f5f6;
  padding-top: 10px;
}
.group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 18px;
  margin-bottom: 10px;
  background-color: #f6f5f6;
  .leftId {
    padding-left: 30px;
    font-weight: 600;
  }
  .rightId {
    color: #787d82;
    padding-right: 15px;
    font-size: 14px;
  }
}
</style>
